Skip to content

Conversation

ixti
Copy link

@ixti ixti commented Jul 3, 2023

Current implementation disrespects expiration TTL, polluting redis with non-expirable keys. Proposed solution wraps Rails.cache (configured with :redis_cache_store) with adapter that respects Rails cache semantics.

Current implementation disrespects expiration TTL, polluting redis with
non-expirable keys. Proposed solution wraps Rails.cache (configured with
:redis_cache_store) with adapter that respects Rails cache semantics.
@ixti
Copy link
Author

ixti commented Jul 3, 2023

It's also worth to mention in the README that configuration like:

Geocoder.configure(
  cache: ...,
  cache_options: { expiration: 1.week },
  ...
)

Sets prefix to nil, not the default geocoder:. We had configuration like:

cache: Geocoder::CacheStore::Generic.new(Rails.cache, {}),
cache_options: { expiration: 1.week },

As a result we have lots of keys both without prefix and without expiration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant